<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"  uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  
  <%@ include file="/WEB-INF/include/menu.jsp"%>
  
  <div class="container main-content">

    <div class="panel panel-default x-panel x-panel-layout">

      <div class="panel-heading">
        <ol class="breadcrumb">
          <li><a href="${ctx.host}/system">系统管理</a></li>
          <li class="active">个人中心</li>
        </ol>
      </div>

      <div class="panel-body">

        <div class="col-xs-2 x-panel-layout-left no-horizontal-padding">
          <%@ include file="/WEB-INF/include/submenu.jsp"%>
        </div>

        <div class="col-xs-10 x-panel-layout-right">

          <div class="x-breadcrumb-wrapper">
            <div class="x-breadcrumb clearfix">
              <h2><i class="glyphicon glyphicon-fire" title="个人信息"></i>&nbsp;&nbsp;<span>个人中心&nbsp;-&nbsp;个人信息</span></h2>
            </div>
          </div>
          
          <div class="x-breadcrumb-wrapper" style="margin-top:20px;">
            <div class="x-breadcrumb yellow clearfix">
              <h2>
                <span>基本信息</span>
                
              </h2>
              <span style="color: red; position: absolute; left: 10px; top: 0px; margin-top: 10px; margin-left: 70px;">
                <c:choose>
                  <c:when test="${restDay < 0}">
                    (你的密码已经过期，请修改密码!!!)
                  </c:when>
                  <c:when test="${restDay eq 0}">
                    (你的密码将于24小时内过期，请及时修改密码!!!)
                  </c:when>
                  <c:when test="${restDay > 0 && restDay < 6}">
                    (你的密码将于${restDay}天后过期，请及时修改密码!!!)
                  </c:when>
                </c:choose>
              </span>
            </div>
            <a href="${ctx.host}/profile/change-password" data-toggle="modal" data-target="#change-password" style="position: absolute; right: 0px; top: 0px; margin-top: 10px; margin-right: 10px;">修改密码</a>
          </div> 
          
          <div class="form-horizontal x-form-horizontal">
            <div class="form-group">
              <label class="control-label col-xs-2 text-right">姓名：</label>
              <div class="col-xs-2">
                <p class="form-control-static">${principal.name}</p>
              </div>
              <label class="control-label col-xs-2 text-right">手机号码：</label>
              <div class="col-xs-2">
                <p class="form-control-static">${principal.mobile}</p>
              </div>
            </div>
            <div class="form-group">
              <label class="control-label col-xs-2 text-right">后台管理权限：</label>
              <div class="col-xs-2">
                <p  class="form-control-static"><span class="label label-${principal.admin ? 'default' : 'success'}">${principal.admin ? '是' : '否'}</span></p>
              </div>
            </div>
            <div class="form-group">
              <label class="control-label col-xs-2 text-right">企业号管理权限：</label>
              <div class="col-xs-2">
                <p  class="form-control-static"><span class="label label-${principal.enterprise ? 'default' : 'success'}">${principal.enterprise ? '是' : '否'}</span></p>
              </div>
            </div>
          </div>
        </div>
          
        </div>

      </div>

    </div>

  <%@ include file="/WEB-INF/include/script.jsp"%>
  
  <d:resource root="${ctx.resource}/build" type="script" src="js/page/system/profile/profile-view.js">
    <script type="text/javascript">
      require(['page/system/profile/profile-view'], function(page) {
        page.init();
      })
    </script>
  </d:resource>
  
</body>

</html>
